package com.ims.core.saleconfig.service.impl;

import java.util.List;
import com.ims.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ims.core.saleconfig.mapper.TSalConfigMapper;
import com.ims.core.saleconfig.domain.TSalConfig;
import com.ims.core.saleconfig.service.ITSalConfigService;

/**
 * 销项系统配置Service业务层处理
 *
 * @author IMS
 * @date 2024-05-19
 */
@Service
public class TSalConfigServiceImpl implements ITSalConfigService
{
    @Autowired
    private TSalConfigMapper tSalConfigMapper;

    /**
     * 查询销项系统配置
     *
     * @param id 销项系统配置主键
     * @return 销项系统配置
     */
    @Override
    public TSalConfig selectTSalConfigById(Long id)
    {
        return tSalConfigMapper.selectTSalConfigById(id);
    }

    /**
     * 查询销项系统配置列表
     *
     * @param tSalConfig 销项系统配置
     * @return 销项系统配置
     */
    @Override
    public List<TSalConfig> selectTSalConfigList(TSalConfig tSalConfig)
    {
        return tSalConfigMapper.selectTSalConfigList(tSalConfig);
    }

    /**
     * 新增销项系统配置
     *
     * @param tSalConfig 销项系统配置
     * @return 结果
     */
    @Override
    public int insertTSalConfig(TSalConfig tSalConfig)
    {
        tSalConfig.setCreateTime(DateUtils.getNowDate());
        return tSalConfigMapper.insertTSalConfig(tSalConfig);
    }

    /**
     * 修改销项系统配置
     *
     * @param tSalConfig 销项系统配置
     * @return 结果
     */
    @Override
    public int updateTSalConfig(TSalConfig tSalConfig)
    {
        tSalConfig.setUpdateTime(DateUtils.getNowDate());
        return tSalConfigMapper.updateTSalConfig(tSalConfig);
    }

    /**
     * 批量删除销项系统配置
     *
     * @param ids 需要删除的销项系统配置主键
     * @return 结果
     */
    @Override
    public int deleteTSalConfigByIds(Long[] ids)
    {
        return tSalConfigMapper.deleteTSalConfigByIds(ids);
    }

    /**
     * 删除销项系统配置信息
     *
     * @param id 销项系统配置主键
     * @return 结果
     */
    @Override
    public int deleteTSalConfigById(Long id)
    {
        return tSalConfigMapper.deleteTSalConfigById(id);
    }
}
